package com.njtoyo.taxi.admin.rest.export;


import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;


/**
 * 布尔型字段转换导出
 */
public class FunctionToChineseConverter implements Converter<Integer> {
    @Override
    public Class<Integer> supportJavaTypeKey() { return Integer.class; }

    @Override
    public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        String chineseValue = "-";
        if(1  == value){
            chineseValue = "正常";
        }else if(0 == value){
            chineseValue = "断开";
        }
        return new WriteCellData<>(chineseValue);
    }
}
